﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="RuneMasterWin8.Pages.StagePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:RuneMasterWin8.Pages"
    xmlns:common="using:RuneMasterWin8.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
		<Style x:Key="ButtonStyleStageItem" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image1" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image1" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.05" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="MouseOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image x:Name="image1" Source="ms-appx:///Images/stageItem.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
								<Image.RenderTransform>
									<CompositeTransform/>
								</Image.RenderTransform>
							</Image>
							<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5">
								<ContentPresenter.RenderTransform>
									<CompositeTransform/>
								</ContentPresenter.RenderTransform>
							</ContentPresenter>
							<Image x:Name="image" Source="ms-appx:///Images/stageItem_lock.png" Stretch="Fill" Visibility="Collapsed"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="FontFamily" Value="Global User Interface"/>
		</Style>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Viewbox>
		<VisualStateManager.VisualStateGroups>
<!-- Visual states reflect the application's view state -->
			<VisualStateGroup x:Name="ApplicationViewStates">
				<VisualState x:Name="FullScreenLandscape"/>
				<VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
				<VisualState x:Name="FullScreenPortrait">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>

                <!-- The back button and title have different styles when snapped -->
				<VisualState x:Name="Snapped">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid Style="{StaticResource LayoutRootStyle}" Height="768" Width="1366">
			<Grid.RowDefinitions>
				<RowDefinition Height="140"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>

			<!-- Back button and page title -->
			<Image Source="ms-appx:///Images/background_dark.png" Stretch="Fill" Grid.RowSpan="2"/>

			<!-- Back button and page title -->
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
				<TextBlock x:Name="pageTitle" Grid.Column="1" Text="选择关卡" Style="{StaticResource PageHeaderTextStyle}" FontFamily="Microsoft YaHei"/>
			</Grid>
			<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,52,50,0" Grid.RowSpan="2">
				<Button Tag="1" Click="btnStage_Click_1" x:Name="btnStage1" Content="1" Margin="32,55,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" Width="108" Height="107" VerticalAlignment="Top" HorizontalAlignment="Left"/>
				<Button Tag="2" Click="btnStage_Click_1" x:Name="btnStage2" Content="2" Margin="185,55,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" Width="108" Height="107" VerticalAlignment="Top"/>
				<Button Tag="3" Click="btnStage_Click_1" x:Name="btnStage3" Content="3" Margin="339,55,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" Width="108" Height="107" VerticalAlignment="Top"/>
				<Button Tag="6" Click="btnStage_Click_1" x:Name="btnStage6" Content="6" Margin="32,225,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" IsEnabled="False" Width="108" Height="107" VerticalAlignment="Top"/>
				<Button Tag="5" Click="btnStage_Click_1" x:Name="btnStage5" Content="5" Margin="185,225,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" IsEnabled="False" Width="108" Height="107" VerticalAlignment="Top"/>
				<Button Tag="4" Click="btnStage_Click_1" x:Name="btnStage4" Content="4" Margin="339,225,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" Width="108" Height="107" VerticalAlignment="Top"/>
				<Button Tag="7" Click="btnStage_Click_1" x:Name="btnStage7" Content="7" Margin="32,405,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" IsEnabled="False" VerticalAlignment="Top" Width="108" Height="107"/>
				<Button Tag="8" Click="btnStage_Click_1" x:Name="btnStage8" Content="8" Margin="185,405,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" IsEnabled="False" Width="108" Height="107" VerticalAlignment="Top"/>
				<Button Tag="9" Click="btnStage_Click_1" x:Name="btnStage9" Content="9" Margin="339,405,0,0" Grid.Row="1" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" Width="108" Height="107" IsEnabled="False" VerticalAlignment="Top"/>
				<Button Tag="10" Click="btnStage_Click_1" x:Name="btnStage10" Content="10" Margin="505,405,-166,0" Style="{StaticResource ButtonStyleStageItem}" Foreground="#FF474747" FontSize="48" FontFamily="Segoe WP" FontWeight="Bold" Width="108" Height="107" IsEnabled="False" VerticalAlignment="Top"/>
				<Grid Margin="143,104,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="297,104,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="143,273,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="297,273,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="143,455,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="297,455,0,0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="373,186,0,0" Grid.Row="1" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Grid.RenderTransform>
						<CompositeTransform Rotation="-90"/>
					</Grid.RenderTransform>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="63,363.5,0,0" Grid.Row="1" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Grid.RenderTransform>
						<CompositeTransform Rotation="-90"/>
					</Grid.RenderTransform>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
				<Grid Margin="457,455,-50,0" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left" VerticalAlignment="Top">
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="14,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
					<Ellipse Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="12" Margin="28,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="12"/>
        
				</Grid>
			</Grid>
			<Grid HorizontalAlignment="Center" VerticalAlignment="Top" Width="250" Height="60" Margin="102,267,1014,0" Grid.Row="1">
				<Image x:Name="imgGameModeEasy" Source="/Images/easy.png" HorizontalAlignment="Center" VerticalAlignment="Center"/>
				<Image x:Name="imgGameModeNormal" Source="ms-appx:///Images/normal.png" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
				<Image x:Name="imgGameModeHard" Source="ms-appx:///Images/hard.png" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
			</Grid>

		</Grid>
	</Viewbox>
</common:LayoutAwarePage>
